home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / MacTech® Magazine / Volume 08 - 1992 / 08.04 Aug 92 / Hello TCL World / TextPane.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-05-20  |  1.4 KB  |  74 lines  |  [TEXT/KAHL]

  1. /*                        TextPane.h                        */
  2. /*
  3.  * TextBox
  4.  *    Superclass:    AuxWindow
  5.  */ 
  6. #define _H_TextPane
  7. #include <CApplication.h>
  8. #include <CBureaucrat.h>
  9. #include <CPane.h>
  10. #ifndef PRIVATE
  11. #define PRIVATE        /* reminder */
  12. #endif
  13.  
  14. PRIVATE struct TextPane : CPane {
  15.     short            itsLineHeight;
  16.     short            itsNLines;
  17.     short            hOffset;
  18.     short            vOffset;
  19.     StringHandle    **vectorHandle;
  20.     
  21.     /*
  22.      * Create a pane that can be used to
  23.      * display lines of text.  The parameters
  24.      * follow the definition of CPane. fontName
  25.      * and fontHeight define the display font
  26.      * and its size. These cannot be changed
  27.      * after the class is created.
  28.      */
  29.     void                    ITextPane(
  30.         CView            *anEnclosure,
  31.         CBureaucrat        *aSupervisor,
  32.         short            aWidth,
  33.         short            aHeight,
  34.         short            aHEncl,
  35.         short            aVEncl,
  36.         SizingOption    aHSizing,
  37.         SizingOption    aVSizing,
  38.         Str255            fontName,
  39.         short            fontHeight
  40.     );
  41.     void                    Dispose(void);
  42.     /*
  43.      * Write a line of text into the pane.
  44.      */
  45.     void                    SetText(
  46.         StringPtr        someText
  47.     );
  48.     /*
  49.      * Get a text item -- this should only be
  50.      * called by DrawItem.
  51.      */
  52.     PRIVATE StringHandle    GetText(
  53.         short            whichItem
  54.     );
  55.     /*
  56.      * Draw the pane or its contents.
  57.      */
  58.     void                    Draw(
  59.         Rect            *area
  60.     );
  61.     /*
  62.      * Draw one line of text.
  63.      */
  64.     PRIVATE void            DrawItem(
  65.         short            whichItem
  66.     );
  67.     /*
  68.      * Scroll the text pane -- called by SetText
  69.      * when a line of text has been added.
  70.      */
  71.     PRIVATE void            ScrollPane(void);
  72. };
  73.  
  74.